import RPi.GPIO as GPIO

# use physical pin numbers
GPIO.setmode(GPIO.BOARD)

# switch off GPIO warnings
GPIO.setwarnings(False)

input_pin = 26

def init():
  # setup input pin, enable pull down resistor
  GPIO.setup(input_pin,GPIO.IN,pull_up_down=GPIO.PUD_DOWN)  

def description():
  print('Optical Receiver pidget methods:')
  print('  init():      initializes input pin')
  print('  get_state(): returns state of receiver')

def get_state():
  return GPIO.input(26)
